package com.chance.cc.crawler.prod.command.trigger.domain.vm.dcdapp;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.vm.dcdapp.DCDAppCommonCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.job.domain.vm.dcdapp.adhoc.DcdappWebPraiseSimpleCrawlerSchedulerJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author lt
 * @version 1.0
 * @date 2021-05-13 14:25:51
 * @email okprog@sina.com
 */
public class DCDAppSimpleCrawlerSchedulerTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {
//        publishSimpleCrawlerScheduleTriggerInfo(DCDAppSeriesSimpleCrawlerSchedulerJob.crawlerScheduler());
//        publishSimpleCrawlerScheduleTriggerInfo(DCDAppBkNewsSimpleCrawlerSchedulerJob.crawlerScheduler());
//        publishSimpleCrawlerScheduleTriggerInfo(DcdappWebPraiseSimpleCrawlerSchedulerJob.crawlerSchedulejob());
//        publishSimpleCrawlerScheduleTriggerInfo(DcdappWebDynamicSimpleCrawlerSchedulerJob.crawlerSchedulejob());

        //精华
       // publishSimpleCrawlerScheduleTriggerInfo(DcdappWebEssenceRealtimeCrawlerSchedulerJob.crawlerSchedulejob());
        //动态
       // publishSimpleCrawlerScheduleTriggerInfo(DcdappWebDynamicRealtimeCrawlerSchedulerJob.crawlerSchedulejob());


        //临时定时起一个调度
//        publishSimpleCornCrawlerScheduleTriggerInfo(DcdappWebPraiseSimpleCrawlerSchedulerJob.crawlerSchedulejob());

        //publishSimpleCrawlerScheduleTriggerInfo(DcdappWebForumRealtimeCrawlerSchedulerJob.crawlerSchedulejob());

        //问答临时采集
     //   publishSimpleCrawlerScheduleTriggerInfo(DcdappWebForumSimpleCrawlerSchedulerJob.crawlerSchedulejob());
        //口碑临时采集
        publishSimpleCrawlerScheduleTriggerInfo(DcdappWebPraiseSimpleCrawlerSchedulerJob.crawlerSchedulejob());
        //大众宝马临时采集 动态板块
        //publishSimpleCrawlerScheduleTriggerInfo(DcdAppDazhongAllSimpleCrawlerScheduleJob.crawlerSchedulejobDongtai());
        //大众宝马临时采集 问答板块
       // publishSimpleCrawlerScheduleTriggerInfo(DcdAppDazhongAllSimpleCrawlerScheduleJob.crawlerSchedulejobWenda());
        //大众宝马临时采集 精华板块
       // publishSimpleCrawlerScheduleTriggerInfo(DcdAppDazhongAllSimpleCrawlerScheduleJob.crawlerSchedulejobJinghua());
        //大众宝马临时采集 口碑板块
       // publishSimpleCrawlerScheduleTriggerInfo(DcdAppDazhongAllSimpleCrawlerScheduleJob.crawlerSchedulejobkoubei());
    }

    /**
     * 发布懂车帝临时采集trigger info

     */
    public static void publishSimpleCrawlerScheduleTriggerInfo(CrawlerJob crawlerJob){

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                DCDAppCommonCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "懂车帝临时采集任务执行，单次执行"
        );
    }

    /**
     * 临时采集文章定时
     * @param crawlerJob
     */
    public static void publishSimpleCornCrawlerScheduleTriggerInfo(CrawlerJob crawlerJob){

        metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(
                crawlerJob.generateCrawlerKey(),
                crawlerJob.generateCrawlerTriggerKey(),
                DCDAppCommonCrawlerSchedulerJob.domain,
                CrawlerMetaConstant.ScheduleJobTrigger_Cron,
                "1 4 0 10 8 ? 2021",
                "懂车帝临时采集任务执行，单次执行"
        );
    }
}
